// 定义默认状态
const defaultState = {
  // 弹框提示
  showToast: false,
  // 弹框类型
  icon: 'success',
  // 弹框内容
  title: '弹框内容',
}

//导出函数
export default (state=defaultState, action) => {
  const newState = JSON.parse(JSON.stringify(state));
  switch (action.type) {
    case 'showToastFn':
      newState.showToast = true
      newState.icon = action.value.icon
      newState.title = action.value.title
      break;
    case 'hideToastFn':
      newState.showToast = false
    default:
      break;
  }
  return newState
}

